\ qprint - quick printer for Mops source files \ July 90 mrh Mops version. // dateTime 9 constant TAB 8 constant TABWIDTH string+ LINBUF : .FOOTER pcr pcr 5 spaces ." Mops source file: " getName: topFile ptype 3 spaces topfile 76 + @ put: sysdate ." Rev: " print: sysDate 7 spaces ." Page " . pcr np ; : PrintCRs FOR pcr NEXT ; : QPRINT { \ theLine thePage ubase #bl #lines -- } \ Exported. pushNew: loadfile 'type TEXT 1 stdGet: topFile NIF drop: loadfile EXIT THEN new: linBuf base -> ubase decimal ['] drop -> emitVec ['] 2drop -> typeVec #lines/page 8 - -> #lines 0 -> theLine 1 -> thePage +print openReadOnly: topFile ?error 132 getfileinfo: topfile drop BEGIN topFile 255 readLine?: linBuf WHILE start: linBuf \ expand tabs BEGIN nolim: linBuf tab chsearch: linBuf WHILE tabWidth lim: linBuf tabWidth mod - -> #bl lim: linBuf >pos: linBuf 1 more: linBuf " " drop #bl repl: linBuf REPEAT theLine 5 .r 3 spaces all: linBuf 90 min ptype pcr 1 ++> theLine theLine #lines mod NIF thePage .footer 1 ++> thePage THEN REPEAT #lines theLine #lines mod - printCRs thePage .footer -print 0 -> emitvec 0 -> typevec release: linBuf drop: loadfile ubase -> base ;